<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Insert title here</title>
    <script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
    <script src="https://lib.baomitu.com/axios/0.19.2/axios.js"></script>
</head>
<body>

<div id="app"></div>


<script>
    var storage=window.localStorage;
    var token =storage.getItem("token");
    var refreshToken =storage.getItem("refreshToken");
    console.log(refreshToken)

    new Vue({

        el:"#app",
        data:{
            products:[]
        },
        mounted(){
            axios.get("/principal/all/2019",{
                headers:{
                    "token":token,
                    "refreshToken":refreshToken
                }
            }).then(res => {
                console.info(res);
                //更新token
                if(res.headers.token!=null){
                    storage.setItem("token",res.headers.token)
                }
            })
        }




    });


</script>

</body>
</html>